<?php
class CommonAction extends BaseAction
{
	/**
	 * 默认初始化
	 * @author ice<iceinto@mallog.com.cn>
	 */
	function _initialize()
	{
		// 用户权限检查
		if($this->getLoginUserInfo()){
			//登陆的用户
			$user = D('User')->getOne($this->getLoginUserInfo());
			$this->assign('user', $user);
			$this->assign('session_id', session_id());
		}else{
			//需要登陆
			$this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
			$this->error(L('_MUST_LOGIN'));
		}
	}

	/**
	 * 获取单个用户信息
	 * @param int $uid
	 * @author ice<iceinto@mallog.com.cn>
	 */
	function getUserById($uid){
		return D('User')->getOne($uid);
	}
}
?>